/* Tab标签栏样式 */
.tab-bar-container {
  position: relative;
  z-index: 5; /* 降低TabBar的z-index，让Menu能够盖住 */
  height: 48px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tab-bar-container {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

.tab-bar-container .tab-title,
.tab-bar-container .tab-icon {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  pointer-events: none;
}

.tab-bar-container.dragging-active {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

.tab-bar-container.dragging-active * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

.tab-scroll-container {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}

.tab-scroll-container::-webkit-scrollbar {
  display: none;
}

.tab-item {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
  white-space: nowrap;
  border-radius: 6px;
  margin: 2px;
}

.tab-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-item.active {
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.25);
  transform: translateY(-1px);
}

.tab-item.dragging {
  opacity: 0.7;
  transform: rotate(2deg);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 拖拽占位符 */
.tab-drag-placeholder {
  width: 120px;
  height: 32px;
  background: rgba(24, 144, 255, 0.1);
  border: 2px dashed #1890ff;
  border-radius: 6px;
  margin: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1890ff;
  font-size: 12px;
  opacity: 0.8;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
}

.tab-item .tab-close-btn {
  opacity: 1;
  transition: all 0.2s ease;
  margin-left: 6px;
}

.tab-close-btn:hover {
  background-color: rgba(255, 77, 79, 0.1) !important;
  color: #ff4d4f !important;
  transform: scale(1.1);
}

/* 标签页图标动画 */
.tab-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  margin-right: 6px;
  font-size: 14px;
}

.tab-item:hover .tab-icon {
  transform: scale(1.1);
}

/* 标签页标题 */
.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 13px;
  transition: color 0.2s ease;
}

/* 操作按钮 */
.tab-operations {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
}

.tab-operation-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tab-operation-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
  transform: scale(1.05);
}

/* 拖拽相关样式 */
.tab-drag-placeholder {
  width: 120px;
  height: 36px;
  border: 2px dashed #d9d9d9;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.02);
  margin: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c8c8c;
  font-size: 12px;
}

/* 新标签页按钮 */
.new-tab-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px dashed #d9d9d9;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
  color: #8c8c8c;
}

.new-tab-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
  background-color: rgba(24, 144, 255, 0.04);
  transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tab-item {
    min-width: 60px;
    max-width: 120px;
  }
  
  .tab-title {
    font-size: 12px;
  }
  
  .tab-operations {
    margin-left: 4px;
    padding-left: 4px;
  }
}

/* 深色主题适配 */
.dark-theme .tab-item:hover {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.dark-theme .tab-item.active {
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.dark-theme .tab-operations {
  border-left-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .tab-operation-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .new-tab-btn {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

.dark-theme .new-tab-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
  background-color: rgba(24, 144, 255, 0.1);
}

/* 确保Ant Design组件的z-index正确 */
.ant-menu {
  z-index: 15 !important;
}

.ant-dropdown {
  z-index: 1050 !important;
}

.ant-menu-submenu-popup {
  z-index: 1050 !important;
}

/* 滚动条样式 */
.tab-scroll-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.tab-scroll-container::-webkit-scrollbar {
  height: 4px;
}

.tab-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.tab-scroll-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.tab-scroll-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}
